Configure Webhook Reception in Teams
NOTE: This documentation was written based on Microsoft Teams documentation at the time of release. Check Teams for the most current documentation.
Teams has an incoming Webhook feature that does not require authentication. Teams uses a unique secret URL that is associated with a channel of a team. By sending POST requests to this URL with a JSON body that matches the expected schema, SysTrack is able to post messages to Teams.
Limitations
The message size limit is 28 KB. When the size exceeds 28 KB, you receive an error. For more information, see Limits and specifications for Microsoft Teams.
Create Incoming Webhooks with Workflows for Teams
-
In Teams, on the left side, select View more apps and then click Workflows.
-
Click Create.
-
Select the Post to a channel when a webhook request is received template.
-
Click Next.
-
Configure the channel you will use for webhooks and click Create flow.
-
Copy and save the unique webhook URL.
-
Click Done.
For more information, see Create incoming webhooks with Workflows for Microsoft Teams.
-
Use the unique webhook URL from step 6 to create a webhook recipient in Configure> Notifications > Recipients tab. See Sensor Notification Recipients.
Webhook Body Template for Teams
Copy and paste this content into the Body section of the Add New Recipient dialog box. Edit as needed.
TIP: For Teams, you need the URL you generated, it must use the POST method, and it needs a body like the one shown below.
{
"type":"message",
"attachments": [
{
"contentType":"application/vnd.microsoft.card.adaptive",
"contentUrl":null,
"content": {
"type": "AdaptiveCard",
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.5",
"msteams": {
"width": "Full"
},
"body": [
{
"type": "TextBlock",
"size": "Large",
"weight": "Bolder",
"text": "@{notificationName}"
},
{
"type": "TextBlock",
"size": "Small",
"weight": "Bolder",
"text": "Activated @{activationTime}",
"isSubtle": true,
"spacing": "None"
},
{
"type": "Table",
"columns": [
{
"width": "90px"
},
{
"width": 1
}
],
"rows": [
{
"type": "TableRow",
"cells": [
{
"type": "TableCell",
"items": [
{
"type": "TextBlock",
"text": "Sensor(s)"
}
]
},
{
"type": "TableCell",
"items": [
{
"type": "TextBlock",
"text": "@{sensorNamesUnquoted}",
"weight": "Default",
"wrap": true
}
]
}
]
},
{
"type": "TableRow",
"cells": [
{
"type": "TableCell",
"items": [
{
"type": "TextBlock",
"text": "Group",
"weight": "Bolder"
}
]
},
{
"type": "TableCell",
"items": [
{
"type": "TextBlock",
"text": "@{groupName}",
"wrap": true
}
]
}
]
},
{
"type": "TableRow",
"cells": [
{
"type": "TableCell",
"items": [
{
"type": "TextBlock",
"text": "Activation",
"weight": "Bolder"
}
]
},
{
"type": "TableCell",
"items": [
{
"type": "TextBlock",
"text": "@{activationThresholdText}",
"wrap": true
}
]
}
]
}
],
"showGridLines": false
},
{
"type": "TextBlock",
"text": "@{notificationDescription}",
"wrap": true,
"isSubtle": true
}
],
"actions": [
{
"type": "Action.OpenUrl",
"title": "Learn More in SysTrack",
"url": "@{notificationActivationDetailsURL}",
"role": "button"
}
]
}
}
]
}
On This Page